package com.python.project2.controller;

import com.python.project2.service.GoodsService;
import com.python.project2.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 商城商品模块后端API
 * @Date 2023/3/31
 * @Author lixian
 **/
@RequestMapping("wx/goods/")
@RestController
public class GoodsController {

	@Autowired
	private GoodsService goodsService;

	@GetMapping("count")
	public Object getCount() {
		Long count = goodsService.getCount();
		if (count == null) {
			return ResponseUtil.fail();
		}
		return ResponseUtil.ok(count);
	}
}
